home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / faqs / faq / 386bsd-faq / part5 < prev    next >
Encoding:
Text File  |  1995-07-25  |  18.0 KB  |  480 lines

  1. Subject: [comp.os.386bsd] BNR/2 derived BSD for PCs FAQ (Part 5 of 10)
  2. Newsgroups: comp.os.386bsd.announce,comp.answers,news.answers
  3. From: burgess@cynjut.infonet.net (Dave Burgess)
  4. Date: 13 Nov 1994 10:41:47 -0600
  5.  
  6. Posted-By: auto-faq 3.1.1.2
  7. Archive-name: 386bsd-faq/part5
  8.  
  9. Section 4.    (System Additions)
  10.  
  11.   Thanks go to  Marc Wandschneider (storm@cs.mcgill.ca) for putting this
  12.   section of the FAQ together..
  13.  
  14.   Important note:  Most of these 'kernel patches' are to the original
  15.   386bsd 0.1.  The really useful ones have been added to the kernel
  16.   of both NetBSD and FreeBSD.
  17.  
  18. 4.0    Introduction
  19.  
  20.     If you have written some addition to the kernel or some other 
  21.     part of the system, or know of one that feel should be mentioned, 
  22.     send mail to Dave Burgess (burgess@cynjut.infonet.net) with all 
  23.     the relevant information, and it will be added for the next 
  24.     release.
  25.  
  26. 4.1    Common Kernel-related problems
  27.  
  28. 4.1.1    Where are the commands "rpcinfo" and "rpcgen"?
  29.  
  30.     Chris Flatters (cflatter@nrao.edu) informs us in the following
  31.     posting excerpt where we can find them:
  32.  
  33.     --------------------------------------------------------------------
  34.     The sources for the Sun OS 4.0 RPC are on titan.rice.edu (I don't 
  35.     have the inet number handy) in directory sun-sources.  You will have 
  36.     to pick up all the shell archives and unpack them to get at rpcgen.
  37.     --------------------------------------------------------------------
  38.  
  39.     These sources are also included in NetBSD and FreeBSD as part of the
  40.     normal installation.
  41.  
  42. 4.1.2    Where can I get a working "netstat"?
  43.  
  44.     When netstat was released, it came out as a binary patch and 
  45.     source patch in the patchkit for 386bsd 0.1.  The program has
  46.     been included in both NetBSD and FreeBSD.
  47.  
  48.  
  49. 4.1.3    How can I fix NFS to work with my NE2000 board?
  50.  
  51.     Ken Raeburn (raeburn@cambridge.cygnus.com) has both identified the
  52.     problem (in 386bsd 0.1) and provided us with a work around:
  53.  
  54.     --------------------------------------------------------------------
  55.     I reported previously that I was seeing problems reading files over
  56.     NFS using the ne2000 driver; timeouts would eventually be reported, no
  57.     data would be read.  Listing files and directories (small ones
  58.     anyways) were not a problem.
  59.  
  60.     After playing with etherfind and kernel printfs, I've come to this
  61.     conclusion: Fragmented 8K UDP packets from the NFS server are not
  62.     reaching the UDP layer in 386bsd.  The Sun is sending them (according
  63.     to another Sun spying on the network), but the UDP input routine is
  64.     never called.  I don't know if the bug here is on the 386bsd or Sun
  65.     side, and won't have time to look into it in the next couple of days.
  66.  
  67.     In the meantime, mounting NFS file systems with "rsize=1024" does get
  68.     rid of this problem.
  69.  
  70.     (It does nothing about TCP being slow, though.)
  71.     Ken
  72.     --------------------------------------------------------------------
  73.  
  74.     Hopefully, the real solution (a UDP fix) will be forthcoming so
  75.     that the slow TCP problem is fixed as well.
  76.  
  77.     See also:  Section 2.6.3.3c "I am getting lousy performance 
  78.            out of my network card.  What are some of the other 
  79.            possibilities?"
  80.  
  81.     Recent work in FreeBSD and NetBSD may have deprecated this problem.
  82.     There is a new network card driver called the ed0 driver.  This
  83.     replaces the original NE1000/NE2000 drivers, as well as replacing
  84.     the we0 driver.  By combining the two, a more flexible driver has
  85.     been developed and most of these types of problems have been fixed.
  86.     Once again, upgrading to FreeBSD or NetBSD seems to be the answer.
  87.  
  88.  
  89. 4.1.4    How can I get "ps" and "w" to work?
  90.  
  91.     The patch-kit contains a fix for /src/lib/libutil/kvm.c, which,
  92.     last we heard, was due to the work of Jim Paradis 
  93.     (paradis@sousa.ltn.dec.com).  New versions of the kernel should
  94.     have this problem fixed.
  95.  
  96.     In order for users to be able to use certain flags with ps and
  97.     the w/uptime commands, the kernel must have permissions 755.
  98.  
  99.     Also, in order to save space on the distribution, the 386bsd 0.1
  100.     kernel is 'stripped' of all its labels.  Programs that rely on 
  101.     those labels will not work.  There are several in this category, 
  102.     including ps, w, and uptime.  Either ftp an un-stripped kernel, 
  103.     or recompile.
  104.  
  105.     Also, when the internal structure of the kernel changes (as
  106.     with the changes to NetBSD and FreeBSD that change fundamental
  107.     parts of the kernel) a new ps, w, and uptime must usually be 
  108.     recompiled.  If you are having trouble with your ps and have 
  109.     recently upgraded/rebuilt your kernel, you will probably have 
  110.     to rebuild ps etal.
  111.  
  112.  
  113. 4.1.5    Where are re_comp and re_exec?
  114.  
  115.     These two functions are currently not in libc.a.  However, there
  116.     are two related functions that seem to work exactly the same in
  117.     all cases we've heard of---These are regcomp() and regexec().
  118.  
  119.     Thus, a pretty ugly fix for the problem would be to always compile
  120.     as follows:
  121.  
  122.     $(CC) -Dre_comp=regcomp -Dre_exec=regexec ....
  123.  
  124.     There is a slightly nicer fix available for this, listed in 4.2
  125.  
  126.  
  127. 4.1.6    Where are stty() and gtty()?
  128.  
  129.     These functions were missing from libc.a in the original 386bsd 0.1.  
  130.     To fix, add the following #defines to your program:
  131.  
  132.     #define stty(f, m)    ioctl((f), TIOCSETP, (m))
  133.     #define gtty(f, m)    ioctl((f), TIOCGETP, (m))
  134.  
  135.     A more elegant solution is to apply the patchkit.  These routines
  136.     are included in there.
  137.  
  138.  
  139. 4.1.7    The system hangs with the HD light on after intense disk usage.
  140.     The system hangs when trying to fsck -p both of my IDE hard drives
  141.     at boot-up.
  142.  
  143.     Brett Lymn (blymn@mulga.awadi.com.AU)  Provides us with a
  144.     description of the problem and the steps that he had to take
  145.     to fix it:
  146.  
  147.         It seems that, on some disk subsystems, the controller and the
  148.     hard disk get out of synchronization when they are being used 
  149.     intensively.  The result of this is that the disk completes a 
  150.     command but the controller still believes the disk not to have 
  151.     completed the command, so the controller status register 
  152.     indicates the disk is busy when it is not really.  The standard 
  153.     wd drivers are too trusting of the hardware and expect it to do 
  154.     the right thing all the time.  There are a few while loops in 
  155.     the wd drivers that loop on a status change from the disk 
  156.     controller, however; if the problem I have described takes place 
  157.     then the wd driver will be stuck looping waiting for the disk to 
  158.     not be busy - which never happens, so you lock the machine because 
  159.     this is a kernel level wait.  To fix this problem I put a timeout 
  160.     into the while loops so that after a specified time the wd driver 
  161.     will give up waiting for the drive to become ready, reset the 
  162.     controller and retry the command.  In my experience the retry 
  163.     always succeeds.
  164.  
  165.     Ed.Note:  The retry doesn't ALWAYS work, but it IS better than 
  166.     just waiting for the drive to wake back up (which it never does).
  167.  
  168.     It has been recently noted that, from time to time, a SCSI disk
  169.     subsystem will behave exactly the same way.  It is usually because
  170.     of bad/out-of-tolerance cables.  It is not a common problem, but it
  171.     is one that you, the reader, may need to take into account when
  172.     you are trouble-shooting your drives.
  173.  
  174.     Dan Yergeau (yergeau@gloworm.Stanford.EDU) provides us with more 
  175.     insight into this problem.  The README accompanying the original 
  176.     sources used as a base for the NetBSD driver indicates that
  177.  
  178.     > There's also another problem still bothering me: There's some 
  179.     sort of timing/reentrancy error still lurking in here, that was 
  180.     there in the original 0.1 wd driver as well.  The symptom is that, 
  181.     on *some* controllers, doing the initial wdopen() (which will 
  182.     then call the readdisklabel() function) for two or more disks at 
  183.     the same time (so that wdopen() gets called again while it's 
  184.     already being executed), the controller gets hung.  I'm still 
  185.     looking for this, meanwhile I specify in my config file that I 
  186.     have swap on all disks.  This causes the kernel to wdopen() the 
  187.     drives nicely in order -- and once it's been done for each disk, 
  188.     the problem will, of course, not occur.  Without the "swap on ... 
  189.     and ... and ..." stuff, my wd1, wd2 and wd3 would be opened 
  190.     simultaneously by "fsck -p" forks, which would nicely hang up 
  191.     everything...  I note a "sleep(10)" in fsck, but it obviously 
  192.     doesn't do that.
  193.  
  194.     So, changing the appropriate config line to
  195.  
  196.     config        "386bsd"    root on wd0 swap on wd0 and wd1
  197.                                                             ^^^^^^^
  198.     may get around the problem.  I don't run NetBSD, but I do use a
  199.     variation of the barsoom/NetBSD driver.  This works for me.  
  200.     Please let the NetBSD people know if it works for you.
  201.  
  202.  
  203. #include <std.disclaimer>
  204.  
  205.     [Ed. again] Other methods for fixing this problem include doing a 
  206.     dd if=/dev/wd1d of=/dev/null count=1 before the initial 'fsck -p'.
  207.     This method is considered brute force.  It works by making sure
  208.     that the drive is properly initialized before the disklabel is
  209.     read in the fsck.
  210.  
  211.     Another method involves using the '-l1' (little L) flag to make sure
  212.     that the fsck doesn't try to open both unopened hard drives at the
  213.     same time.  This method is a little better (from a purely brute
  214.     viewpoint) but does caused your startup to run longer, since the
  215.     purpose of this option is to have each of your fsck passes run
  216.     one after another.
  217.  
  218.  
  219. 4.1.8    How do you implement quotas on Net/2 derived BSD systems?
  220.  
  221.     From: tinguely@plains.NoDak.edu (Mark Tinguely)
  222.  
  223.      maybe you did not complete the setup, here is a step-by-step 
  224.      instructions to get them to work:
  225.  
  226.     1)  make a kernel with "options QUOTA" installed
  227.  
  228.     2)  edit /etc/fstab and include the kinds of quotas you want, 
  229.         below I used "userquota", you could also add "groupquota".
  230.  
  231.     /dev/wd0h        /usr        ufs    rw,userquota 1 2
  232.  
  233.     3)  for each filesystem that is in /etc/fstab that uses quota,
  234.         create the file "quota.user" (and "quota.group if appropriate).
  235.         Above I have user quotas in the /usr filesystem, so I would:
  236.  
  237.         # touch /usr/quota.user
  238.  
  239.     4)  scan filesystem for files ownership (and/or group ownership).
  240.  
  241.         # quotacheck -a
  242.  
  243.     5)  now you can add individual quota limits, if you want to add 
  244.         the same quotas to the many people, then make a template and 
  245.         replicate the template.  If they change for each user, then 
  246.         edit seperately.
  247.  
  248.         # edquota tinguely
  249.  
  250.      (an editor is kicked up and says something like:
  251.  
  252.     Quotas for user tinguely:
  253.       /usr: blocks in use: 11876, limits (soft = 0, hard = 0)
  254.             inodes in use: 891, limits (soft = 0, hard = 0)
  255.  
  256.      a limit of 0 means "unlimited".  Change these to the appropriate 
  257.      number of blocks.  A soft limit generates a warning, and can be 
  258.      exceed for period of time (7 days?), after which time a soft limit 
  259.      is treated like a hard limit.  A hard limit denies new writes.
  260.  
  261.      to replicate a template (for this example let us assume "tinguely" 
  262.      is the template):
  263.  
  264.         # edquota -p tinguely user1 user2 user3 ... userN
  265.  
  266.     6)  turn quotas on (usually done in the /etc/rc file, but turn it 
  267.         on manually so you do not have to reboot right now:
  268.  
  269.         # quotaon
  270.  
  271.     that should take care of setting up quotas.  You can look at the 
  272.     status of use of files with repquota, the -a option lists all 
  273.     filesystems with quotas.
  274.  
  275.  
  276. 4.2    Available kernel add-ons
  277.  
  278.  
  279. 4.2.1    The Patch-Kit
  280.  
  281.     Perhaps the most famous of all additions to the kernel, the Patch-Kit,
  282.     coordinated by Rodney Grimes (rgrimes@agora.rain.com) contained 
  283.     numerous bug fixes, Julian's SCSI drivers, as well as fixes
  284.     for other parts of the system.
  285.  
  286.     It is highly recommended that all users with space for the source code
  287.     apply the patch-kits as many things that seem broken in 0.1 suddenly
  288.     start working with the patch-kits.
  289.  
  290.     Of course, there is no such thing as a patch kit for NetBSD or FreeBSD.
  291.     The update method for these systems is different, and covered in the
  292.     section about the System Update Protocol (sup) updates.
  293.  
  294.  
  295. 4.2.2    Shared Libraries
  296.  
  297.     A basic and experimental implementation of shared libraries exists
  298.     for 386bsd.  According to the author (Dr. Joerg Lohse, 
  299.     lohse@tech7.informatik.uni-hamburg.de), features are as follows:
  300.  
  301.     -No kernel extension is necessary
  302.     -Shared libraries use the approach used in SysV.
  303.  
  304.     Others are also working on different implementations of shared
  305.     libraries.
  306.  
  307.     Bill and Lynne have adopted a shared-library implementation based
  308.     on Dr. Lohse's original work.  It will be included in Version 0.2
  309.     of 386bsd.
  310.  
  311.     For NetBSD and FreeBSD users, two seperate and different shared 
  312.     library systems have been developed.  This feature is included in
  313.     the '-current' tree of both systems, and will be included in the
  314.     next major release of eiter or both.
  315.  
  316.     The shared libs have, in general, been very well behaved.  The
  317.     closest thing to a FAQ that has been introduced is the
  318.     following: 
  319.  
  320.  
  321.     I installed FreeBSD-1.1-BETA a few weeks ago but can't get
  322.     dynamically linked programs to run for some reason.  Every time
  323.     I try to run a dynamically linked program, I get a message that 
  324.     says "No ld.so"...    
  325.  
  326.     The answer is: 
  327.  
  328.     # chmod 755 /usr/* /usr/share/misc
  329.  
  330.  
  331. 4.2.3    Sound Blaster Drivers
  332.  
  333.     A driver for the Sound Blaster card has been written by Steve
  334.     Haehnichen (steveh@ucsd.edu) for BSD.  Steve Gerakines has
  335.     provided us with the information necessary to get this driver 
  336.     working under 386bsd.
  337.  
  338.     Most features of the SB family of cards are supported save some
  339.     stereo portions of the SBPro cards.
  340.  
  341.     NetBSD and FreeBSD have also adapted soundblaster drivers.  They
  342.     are included in either the -current tree or in the most recent 
  343.     release (depending on when you read this).
  344.  
  345.     For a fact, the following sound cards are supported in FreeBSD:
  346.  
  347.         1    Yamaha FM Synth
  348.         2    Soundblaster/Soundblaster Pro DSP
  349.         3    PAS PCM and Midi
  350.         4    Gravis UltraSound
  351.         5    MPU-401
  352.  
  353.     In the release notes I have, there is some doubt as to the 
  354.     operational status of the MPU-401 sound card driver.  If you have 
  355.     one of these cards and want to try the driver out, you should 
  356.     contact Jordan Hubbard (jkh@freefall.cdrom.com) when you are 
  357.     finished installing it and let him know how it is working.
  358.  
  359.     The docs for the FreeBSD driver are in 
  360.     /usr/src/sys/i386/doc/sound.doc.
  361.     
  362.  
  363. 4.2.4    Bus Mouse Drivers
  364.  
  365.     Fred Cawthorne (fcawth@delphi.umd.edu) wrote a busmouse
  366.     driver for 386bsd.  He recently wrote a short letter with this
  367.     update:
  368.  
  369.     This is taken from the INDEX in the Freebsd.cdrom.com mice 
  370.     directory:
  371.  
  372.     "We currently have four bus mouse drivers for 386bsd available by
  373.     anonymous ftp on XFree-86.cdrom.com in pub/XFree86/mice:
  374.  
  375.     ms-busmouse.tar.z
  376.  
  377.         Sandi Donno's <sandi@uctcs.cs.uct.ac.za.> port of 
  378.         Erik Forsberg's Microsoft bus mouse driver to 386bsd.
  379.  
  380.     logitech-busmouse-0.2.shar.z
  381.  
  382.         Fred Cawthorne's <fcawth@delphi.umd.edu> second version 
  383.         of a logitech Bus Mouse driver.  
  384.  
  385.     busmouse.tar.z:
  386.  
  387.         Eugene Stark's port of Rick Macklem's driver to the 
  388.         Microsoft bus mouse.  Rick's driver supports the 
  389.         Logitech and ATI Inport Bus mice with 386bsd.  It's also 
  390.         available by e-mail to stark@cs.sunysb.edu and by anon. 
  391.         ftp on cs.sunysb.edu in pub/386BSD/busmouse.tar.Z.
  392.  
  393.     psm.tar.z:
  394.  
  395.         Johan Solhed <Johan.Solhed@lu.erisoft.se> ported the 
  396.         Linux PS/2 mouse driver to 386BSD.  It includes a PS/2 
  397.         to Microsoft protocol converter in the driver so XFree86 
  398.         understands the mouse events.
  399.  
  400.     In addition we have busmouse.v3.z which is Erik Forsberg's original
  401.     post of his device driver for BSDI/386 and Microsoft (and
  402.     compatible) bus mice using the Microsoft InPort chip as well as a
  403.     device driver for Logitech bus mice. "
  404.  
  405.     Most of these busmouse drivers are now included in the current
  406.     releases of NetBSD and FreeBSD.  There is some question about
  407.     how well they work (especially the psm driver), but they are
  408.     all there.
  409.  
  410.  
  411. 4.2.5    PPP Support
  412.  
  413.     PPP support is included in NetBSD and FreeBSD.  With the demise
  414.     of agate's support for 386BSD, there is no way to add ppp
  415.     support to 386BSD.  You must upgrade to wither FreeBSD or
  416.     NetBSD.
  417.  
  418.  
  419. 4.2.6    re_comp and re_exec library functions
  420.  
  421.     As mentioned in section 4.1, re_comp and related functions, such
  422.     as re_exec, are currently not in the library libc.a.  Apart from
  423.     using the rather crude fix listed above, there is another option.
  424.  
  425.     Kim Anderson (kim@dde.dk) has provided a patch that will add these
  426.     to libc.a.  You can probably obtain this patch from the author, or
  427.     you can ftp it from binkley.cs.mcgill.ca in pub/386bsd.
  428.  
  429.     These functions are (I think) included in the libcompat.a that
  430.     comes with both NetBSD and FreeBSD.
  431.  
  432.  
  433. 4.2.7    Intel i82586 Ethernet Controller driver
  434.  
  435.     Garrett A. Wollman has written a 386bsd 0.1 driver for the 
  436.     Intel i83586 Ethernet Controller.  The author's e-mail address 
  437.     is listed as wollman@emba.uvm.edu.
  438.  
  439.  
  440. 4.2.8    PC Speaker driver for Nethack
  441.  
  442.     Andrew A. Chernov has ported the Nethack PC Speaker driver to
  443.     386bsd.  It allows the speaker to be controlled by applications.
  444.  
  445.     Unfortunately, we are not aware of a site that distributes this,
  446.     but this patch has been posted a couple of times to the various
  447.     comp.os.386bsd groups, and the author can be contacted at
  448.     ache@astral.msk.su
  449.  
  450.     The patch that is included in the NetBSD and FreeBSD source trees
  451.     is one written by Soerne Schmitt.  It appears to use the Sun-style
  452.     /dev/audio interface and is different in goals and implementation
  453.     from Andrew Chernov's speaker driver.  The source for this package
  454.     is included in the source trees for both, but is not included in 
  455.     the distribution kernels.
  456.  
  457.  
  458. 4.3    Other program building type problems.
  459.  
  460. 4.3.1    Greetings from Mars.  I am building a program that requires access
  461.     to the crypt library.  Either I have it and it isn't getting copied
  462.     into the executable, or I don't have it; why?
  463.  
  464.     This is actually two separate questions, but they are close enough
  465.     to the same that I can answer them here.  The first problem that
  466.     anyone building a 'crypt' aware program needs to remember is that
  467.     the crypt library is a separate library and requires a '-lcrypt' 
  468.     to be added at the end of the link line.  The other half of the 
  469.     problem is the 'US Non Export' policy for DES encryption.  There 
  470.     are several good sources (about one per country) for non-US
  471.     crypt libraries.  IF you are outside the US and need one, look 
  472.     around on some of the NetBSD/FreeBSD/386BSD FTP sites in the 
  473.     'local area'.
  474. -- 
  475. TSgt Dave Burgess           | Dave Burgess
  476. NCOIC, USSTRATCOM/J6844     | *BSD FAQ Maintainer
  477. Offutt AFB, NE              | Burgess@cynjut.infonet.net or ...@s069.infonet...
  478.                                
  479.  
  480.